--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 997de18d78cfedafac446515b00a9e9d5f34ef71
Parents : 7f30ffe
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-03T22:14:06-06:00
refactor(ReticulumMeshChat): extract exit logic into a separate method for improved readability
Changes
Diff
diff --git a/meshchatx/meshchat.py b/meshchatx/meshchat.py
index 88adfe1b..09a1a4e2 100644
--- a/meshchatx/meshchat.py
+++ b/meshchatx/meshchat.py
@@ -1834,6 +1834,9 @@ class ReticulumMeshChat:
except Exception: # noqa: S110
pass
+ def exit_app(self, code=0):
+ sys.exit(code)
+
def get_routes(self):
# This is a bit of a hack to get the routes without running the full server
# It's mainly for testing purposes
@@ -3257,7 +3260,7 @@ class ReticulumMeshChat:
async def do_shutdown():
await asyncio.sleep(0.5) # give some time for the response to be sent
await self.shutdown(None)
- sys.exit(0)
+ self.exit_app(0)
asyncio.create_task(do_shutdown())
return web.json_response({"message": "Shutting down..."})
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────